<template>
  <el-date-picker
    v-model="value"
    @update:modelValue="emits('update:modelValue', $event)"
    type="date"
    value-format="YYYY-MM-DD"
    :clearable="clearable"
    :disabled="disabled"
    :placeholder="placeholder || PlaceholderMap.select"
  />
</template>
<script lang="ts" setup>
import {ref} from 'vue';
import {PlaceholderMap} from '../constants';

const props = defineProps<{
  modelValue: string;
  clearable?: boolean;
  disabled?: boolean;
  placeholder?: string;
}>();
const emits = defineEmits<{
  (_e: 'update:modelValue', _value: string): void;
}>();

const value = ref(props.modelValue);
</script>
